<template>
    <div>
        <div>
            <p>
                <textarea v-model="state.commentText"></textarea>
            </p>
            <p>
                <button @click="addComment(userInfoStore.userInfo)">提交评论</button>
            </p>
        </div>
        <div>
            <ul>
            <comment-comp :data="state.commentTree" :user-info="userInfoStore.userInfo" @add-reply="addReply"></comment-comp>
            </ul>
        </div>
</div>
</template>
<script setup>
import useUserInfoStore from "../../store/user.js";
import CommentComp from './CommentComp.vue';
import Comment from './Comment.js';
const userInfoStore = useUserInfoStore();

const {state,addReply,addComment} = new Comment('one');
</script>
<style lang="scss" scoped></style>
